home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / rexx / openemodule.ced < prev    next >
Text File  |  1995-04-06  |  2KB  |  75 lines

  1. /* */
  2. /*
  3.     showmodule module
  4. */
  5. OPTIONS RESULTS
  6.  
  7. show='sys:AMIGAE/showmodule'
  8.  
  9. LIBS.dos = '00 00 00 00'x
  10. LIBS.dos.OPENCOUNT = 0
  11. LIBS.dos.Open='FFE2'x||SI||'200203'x
  12. LIBS.dos.Close='FFDC'x||A||'2002'x
  13. LIBS.dos.Execute='FF22'x||SAA||'20020304'x
  14. LIBS.dos.SystemTagList='FDA2'x||SS||'200203'x
  15.  
  16. SYS_Dummy='80000020'x
  17. SYS_Input='80000021'x
  18. SYS_Output='80000022'x
  19. SYS_Asynch='80000023'x
  20. SYS_UserShell='80000024'x
  21. SYS_CustomShell='80000025'x
  22.  
  23. IF ~SHOW('L','rexxsupport.library') THEN CALL ADDLIB('rexxsupport.library',0,-30,0)
  24. IF ~SHOW('L','rxgen.library')       THEN CALL ADDLIB('rxgen.library',0,-30,0)
  25.  
  26. call GenOpenLib("dos",0)
  27.  
  28. ih=GenACall("dos","Open","NULL:",1005)
  29. IF ih=NULL() THEN GOTO finish
  30. oh=GenACall("dos","Open","NULL:",1006)
  31. IF oh=NULL() THEN GOTO finish
  32.  
  33. GETFILENAME 'EMODULES:mods/' 'select E module'
  34. t=RESULT
  35. IF t='RESULT' THEN EXIT 0
  36. PARSE VAR t modpath'.m'
  37. t=modpath
  38. PARSE VAR t modpath'.e'
  39.  
  40. c=POS(':',modpath)
  41. txtpath='RAM:emodules/'||SUBSTR(modpath,c+1)
  42. IF EXISTS(txtpath'.txt')=0 THEN DO
  43.   CALL MakePath(txtpath)
  44. /*
  45.   CALL DoShell('AMIGAE:BIN/showmodule >'txtpath'.txt 'modpath'.m')
  46. */
  47.   CALL DoShell(show '>'txtpath'.txt 'modpath'.m')
  48. END
  49.  
  50. OPEN NEW
  51. OPEN txtpath'.txt'
  52.  
  53. finish:
  54. IF ih~=NULL() THEN call GenACall("dos","Close",ih)
  55. IF oh~=NULL() THEN call GenACall("dos","Close",oh)
  56. call GenCloseLib("dos")
  57. EXIT
  58.  
  59. DoShell:
  60.   PARSE ARG cmd
  61.   r=GenACall("dos","SystemTagList",cmd||NULL(),SYS_Input||ih||SYS_Output||oh||NULL())
  62. RETURN r
  63.  
  64. MakePath:
  65.   PARSE ARG path
  66.   c=POS(':',path)+1
  67.   s=POS('/',path,c)
  68.   DO WHILE s~=0
  69.     dir=LEFT(path,s-1)
  70.     CALL DoShell('sys:c/makedir 'dir)
  71.     t=s+1
  72.     s=POS('/',path,t)
  73.   END
  74. RETURN
  75.